<%#
 Copyright 2008 Steven Barth <steven@midlink.org>
 Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
 Licensed to the public under the Apache License 2.0.
-%>

<html>
	<head>
		<title><%=luci.sys.hostname()%> - <%= title or translate("Rebooting...") %></title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<style type="text/css">
			* {
				margin: 0;
				padding: 0;
			}
			html,body {
				width: 100%;
				height: 100%;
				background: #6a7893;
				color: #e5e5e5;
			}
			.page-content {
				width: 100%;
				height: 100%;
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;
				box-sizing: border-box;
			}
			.container {
				width: 620px;
				display: block;
				background: #272727;
				padding: 40px;
				border-radius: 8px;
				box-sizing: border-box;
				box-shadow: 0 0 10px rgba(0, 0, 0, .2);
			}
			
			h1 {
				text-align: center;
				font-size: 24px;
			}
			
			h3 {
				text-align: center;
			}
			
			p {
				margin: 0 0 14px;
				font-size: 16px;
				line-height: 1.5;
			}
			
			.logo {
				text-align: center;
				margin: 0 0 20px;
			}
			
			a {
				color: #0078d4bd;
				text-decoration: none;
			}
			
			@media only screen and (max-width: 767px) {
				.page-content {
					padding: 20px
				}
			
				.container {
					width: auto;
					padding: 30px;
				}
			}
		</style>
		<script type="text/javascript">//<![CDATA[
			var interval = window.setInterval(function() {
				var img = new Image();
				var target = ('https:' == document.location.protocol ? 'https://' : 'http://') + <%=addr and "'%s'" % addr or "window.location.host"%>;

				img.onload = function() {
					window.clearInterval(interval);
					window.location.replace(target);
				};

				img.src = target + '<%=resource%>/icons/loading.gif?' + Math.random();

			}, 20000);
		//]]></script>
	</head>
	<body>
	<div class="page-content">
		<div class="container">
			<div class="logo">
				<img width="130" src=""/>
			</div>
            <div class="content">
				<h1><%:System%> - <%= title or translate("Rebooting...") %></h1>
				<p></p>
				<div>
					<p><%= msg or translate("Changes applied.") %></p>
				</div>
				<div>
					<img width="30" src="" alt="<%:Loading%>" style="vertical-align:middle" />
					<%:Waiting for device...%>
				</div>
			</div>
		</div>
	</body>
</html>
